import Vue from 'vue'

import {
  Dialog,
  Form,
  FormItem,
  Input,
  Button,
  Container,
  Header,
  Main,
  Scrollbar,
  Dropdown,
  DropdownMenu,
  DropdownItem,
  Submenu,
  Badge,
  Loading,
  MessageBox,
  Message,
  Menu,
  MenuItem,
  ButtonGroup,
  Select,
  Option,
  Table,
  TableColumn,
  Col,
  Row,
  Cascader,
  RadioGroup,
  Radio,
  DatePicker,
  Autocomplete,
  Upload,
  Image,
  OptionGroup,
  Pagination,
  Tabs,
  TabPane,
  Checkbox,
  CheckboxGroup,
  Popover,
  Tree,
  Timeline,
  TimelineItem,
  Switch,
  TimeSelect,
  InputNumber,
  Tag
} from 'element-ui'

export const message = opt => Message({ ...opt, offset: 120 })
Vue.use(Dialog)
Vue.use(Form)
Vue.use(FormItem)
Vue.use(Input)
Vue.use(Button)
Vue.use(Container)
Vue.use(Header)
Vue.use(Main)
Vue.use(Scrollbar)
Vue.use(Dropdown)
Vue.use(DropdownMenu)
Vue.use(DropdownItem)
Vue.use(Submenu)
Vue.use(Badge)
Vue.use(Menu)
Vue.use(MenuItem)
Vue.use(ButtonGroup)
Vue.use(Select)
Vue.use(Option)
Vue.use(Loading.directive)
Vue.use(Table)
Vue.use(TableColumn)
Vue.use(Col)
Vue.use(Row)
Vue.use(Cascader)
Vue.use(Radio)
Vue.use(RadioGroup)
Vue.use(Autocomplete)
Vue.use(DatePicker)
Vue.use(Upload)
Vue.use(Image)
Vue.use(OptionGroup)
Vue.use(Pagination)
Vue.use(Tabs)
Vue.use(TabPane)
Vue.use(Row)
Vue.use(Checkbox)
Vue.use(CheckboxGroup)
Vue.use(Popover)
Vue.use(Tree)
Vue.use(Timeline)
Vue.use(TimelineItem)
Vue.use(Switch)
Vue.use(TimeSelect)
Vue.use(InputNumber)
Vue.use(Tag)

// 这两个组件注册在全局，不能用Vue.use()

Vue.prototype.$loading = Loading.service
Vue.prototype.$msgbox = MessageBox
Vue.prototype.$alert = MessageBox.alert
Vue.prototype.$confirm = MessageBox.confirm
Vue.prototype.$prompt = MessageBox.prompt
Vue.prototype.$message = message
